netstat -n | awk '/^tcp/ {++S[$NF]} END{ print "{";for (a in S) printf("\"%s\":%s,",a,S[a]);print "}"}' | tr -d '\n'
